package cc.yugu.yhdw.common.domain.basic;

import cc.yugu.yhdw.common.domain.IntIdEntity;
import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * 手机升级实体类
 *
 * @Date:Created in 2018/7/25 14:44
 * @Author:
 * @Modified By: zjn 2018/7/25 14:44
 */
public class UpgradePack extends IntIdEntity {

    public enum Type {
        ANDROID(1, "安卓"),
        IOS(2, "ios"),
        CABINET(3, "终端"),;


        private final int value;
        private final String name;

        private Type(int value, String name){
            this.value = value;
            this.name = name;
        }

        public static Map<Integer,String> map = new HashMap<Integer,String>();
        static {
            for (User.Type e : User.Type.values()) {
                map.put( e.getValue(),e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }
    String upgradeName; // 升级包名称
    String fileName;   // 文件名称
    String filePath;  // 文件路径
    String descFile;
    String version;  // 版本
    String memo;   // 备注
    String format; // 格式
    String suffix; // 后缀
    Integer type;
    Date updateTime;

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getUpgradeName() {
        return upgradeName;
    }

    public void setUpgradeName(String upgradeName) {
        this.upgradeName = upgradeName;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getDescFile() {
        return descFile;
    }

    public void setDescFile(String descFile) {
        this.descFile = descFile;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }
}
